<template>
  <view class="main-page">
    <view class="content">
      <view class="main">
        <Homepage v-show="currentTab === 'homepage'" />
        <Attendance v-if="currentTab === 'attendance' && attendanceReload" />
        <Approval v-if="currentTab === 'approval' && approvalReload" />
        <User v-show="currentTab === 'user'" />
      </view>
    </view>
    <van-tabbar
      :active="active"
      active-color="#569288"
      @change="onChange($event)"
    >
      <van-tabbar-item>
        <image
          slot="icon"
          :src="homepage.default"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        <image
          slot="icon-active"
          :src="homepage.active"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        主页
      </van-tabbar-item>
      <van-tabbar-item>
        <image
          slot="icon"
          :src="attendance.default"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        <image
          slot="icon-active"
          :src="attendance.active"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        考勤
      </van-tabbar-item>
      <van-tabbar-item>
        <image
          slot="icon"
          :src="approval.default"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        <image
          slot="icon-active"
          :src="approval.active"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        审批
      </van-tabbar-item>
      <van-tabbar-item>
        <image
          slot="icon"
          :src="user.default"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        <image
          slot="icon-active"
          :src="user.active"
          mode="aspectFit"
          style="width: 90rpx; height: 46rpx; max-width:50px; max-height:25px"
        />
        我的
      </van-tabbar-item>
    </van-tabbar>
  </view>
</template>
<script src="./script.js"></script>
<style lang="less" src="./style.less"></style>
